package Engine;

import java.awt.Color;
import java.awt.event.*;
import javax.swing.*;

public class Engine {

	JFrame frame = new JFrame();
	JPanel gamepanel = new JPanel();

	protected void setgamepanelColor(Color color) {
		gamepanel.setBackground(color);
	}

	protected void createWindow(String title, int w, int h) {
		gamepanel.setLayout(null);
		frame.setSize(w, h);
		frame.setTitle(title);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.add(gamepanel);
		frame.setLocationRelativeTo(null);
		frame.setVisible(true);
		System.out.println("Start Up Worked");
	}

	protected void createButton(String Name, int x, int y, int w, int h) {
		final JButton button = new JButton(Name);
		button.setBounds(x, y, w, h);
		button.setFocusable(true);
		gamepanel.add(button);
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				System.out.println("Button " + button.getText() + " Pressed");
			}
		});
	}
	
	
}
